import Book.BookList;
import User.AdminUser;
import User.MormalUser;
import User.User;
import java.util.Scanner;
public class Main {
    public static User login() {
        System.out.print("请输入你的姓名：>>");
        Scanner scan = new Scanner(System.in);
        String name = scan.nextLine();
        System.out.println("0->管理员     1->借阅者");
        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        if (choice == 0) {
            return new AdminUser(name);
        } else {
            return new MormalUser(name);
        }
    }

    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user = login();
        while (true) {
            int choice = user.meau();
            user.doOperation(choice,bookList);
        }
    }
}
